import api from  '../../api/getAirpolutionExponent'
import * as types from '../mutation-types'

// initial state
const state = {
  polutionInfo: {}
}

const getters = {
  polutionInfo: state => state.polutionInfo,
}

const actions = {
  getAirPolutionExponent ({commit, state},lngLat) {
    api.getExponent(lngLat,(reponse)=> {
      commit(types.SET_AIRPOLUTION_EXP,reponse);
    })

  },
}

const mutations = {
  [types.SET_AIRPOLUTION_EXP](state,polutionInfo){
    state.polutionInfo = polutionInfo;
  }
}

export default {
  state,
  getters,
  actions,
  mutations
}